import request from '../utils/axios-config'

// 获取秒杀商品分页数据
export function getSeckillPage(params) {
  return request({
    url: '/admin/seckill/page',
    method: 'get',
    params
  })
}

// 获取秒杀商品详情
export function getSeckillDetail(seckillId) {
  return request({
    url: `/admin/seckill/detail/${seckillId}`,
    method: 'get'
  })
}

// 创建秒杀商品
export function createSeckill(data) {
  return request({
    url: '/admin/seckill/create',
    method: 'post',
    data
  })
}

// 更新秒杀商品
export function updateSeckill(data) {
  return request({
    url: '/admin/seckill/update',
    method: 'put',
    data
  })
}

// 删除秒杀商品
export function deleteSeckill(seckillId) {
  return request({
    url: `/admin/seckill/${seckillId}`,
    method: 'delete'
  })
}

// 更新秒杀状态
export function updateSeckillStatus(seckillId, status) {
  return request({
    url: `/admin/seckill/updateStatus/${seckillId}`,
    method: 'put',
    params: { status }
  })
}

